#define  _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<string.h>

int main()
{
    char a[101] = { 0 }, b[101] = { 0 }, arr[101] = { 0 };
    while (scanf("%s %s", a, b) != EOF)
    {
        int i = 0, len_a = strlen(a), len_b = strlen(b), j = 0, temp = 0, k = 0, flag = 1, t = 0;
        for (i = 0; 1; i++)
        {
            temp = len_b;
            strcpy(arr, " ");
            for (j = i, k = 0; temp; j++)
            {
                arr[k++] = a[j];
                temp--;
                if (j == len_a - 1)
                {
                    t = 1;
                    break;
                }
            }
            if (strcmp(arr, b) == 0)
            {
                printf("%d\n", i + 1);
                flag = 0;
                break;
            }
            if (t == 1)
                break;
        }
        if (flag == 1)
            printf("0\n");
    }


    return 0;
}